package jmine.tec.utils.date;

import bancosys.tec.utils.date.Timestamp;

/**
 * Representa um intervalo de tempo.
 * 
 * @author Marcio Ribeiro (mmr)
 * @created Dec 2, 2011
 */
public class Interval {
    private final Timestamp start;

    private final Timestamp end;

    /**
     * Construtor.
     * 
     * @param start start.
     * @param end end.
     */
    public Interval(long start, long end) {
        this(new Timestamp(start), new Timestamp(end));
    }

    /**
     * Construtor.
     * 
     * @param start start.
     * @param end end.
     */
    public Interval(Timestamp start, Timestamp end) {
        this.start = start;
        this.end = end;
    }

    /**
     * @return the requestStart
     */
    public Timestamp getStart() {
        return start;
    }

    /**
     * @return the requestEnd
     */
    public Timestamp getEnd() {
        return end;
    }

    /**
     * @return delta entre fim e inicio.
     */
    public long getInterval() {
        return this.end.getTime() - this.start.getTime();
    }
}